package org.jackkang.elasticsearch.service.impl;

import java.util.HashMap;
import java.util.List;

import org.apache.log4j.Logger;
import org.jackkang.elasticsearch.mapper.NewsMapper;
import org.jackkang.elasticsearch.model.News;
import org.jackkang.elasticsearch.service.NewsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Isolation;
import org.springframework.transaction.annotation.Transactional;

@Service
@Transactional(isolation = Isolation.DEFAULT, rollbackFor = Exception.class)
public class NewsServiceImpl implements NewsService {

	public static final Logger logger = Logger.getLogger(NewsServiceImpl.class);

	@Autowired
	private NewsMapper newsMapper;

	public int getNewsCount() {
		return newsMapper.getNewsCount();
	}

	public List<News> getNewsList(HashMap<String, Object> paramMap) {
		return newsMapper.getNewsList(paramMap);
	}
}
